<?php

namespace App\Trip\Orders\BookOrders\Params\AbstractParam;

use Carbon\Carbon;

abstract class TripParam
{
    abstract function getTripInfo();

    abstract function toArray(): array;

    abstract function getFrom();

    abstract function getTo();

    function getStartDate(): string
    {
        return Carbon::parse($this->getStartAt())->toDateString();
    }

    abstract function getStartAt(): string;

    function getArriveDate(): string
    {
        return Carbon::parse($this->getArriveAt())->toDateString();
    }

    abstract function getArriveAt(): string;

    function getStartTime(): string
    {
        return Carbon::parse($this->getStartAt())->format('H:i');
    }

    function getArriveTime(): string
    {
        return Carbon::parse($this->getArriveAt())->format('H:i');
    }

    /**
     * train code || flight no || 酒店名称代码之类的
     */
    abstract function getTripCode(): string;

    abstract function getFromCode(): string;

    abstract function getToCode(): string;

    abstract function getFromName(): string;

    abstract function getToName(): string;

    abstract function getFromNameUy(): string;

    abstract function getToNameUy(): string;
}

